import 'package:work_tools/generated/json/base/json_convert_content.dart';
import 'package:work_tools/model/token_entity.dart';

TokenEntity $TokenEntityFromJson(Map<String, dynamic> json) {
  final TokenEntity tokenEntity = TokenEntity();
  final String? aId = jsonConvert.convert<String>(json['aId']);
  if (aId != null) {
    tokenEntity.aId = aId;
  }
  final String? rId = jsonConvert.convert<String>(json['rId']);
  if (rId != null) {
    tokenEntity.rId = rId;
  }
  final int? loginStatus = jsonConvert.convert<int>(json['loginStatus']);
  if (loginStatus != null) {
    tokenEntity.loginStatus = loginStatus;
  }
  final String? mobile = jsonConvert.convert<String>(json['mobile']);
  if (mobile != null) {
    tokenEntity.mobile = mobile;
  }
  return tokenEntity;
}

Map<String, dynamic> $TokenEntityToJson(TokenEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['aId'] = entity.aId;
  data['rId'] = entity.rId;
  data['loginStatus'] = entity.loginStatus;
  data['mobile'] = entity.mobile;
  return data;
}

extension TokenEntityExtension on TokenEntity {
  TokenEntity copyWith({
    String? aId,
    String? rId,
    int? loginStatus,
    String? mobile,
  }) {
    return TokenEntity()
      ..aId = aId ?? this.aId
      ..rId = rId ?? this.rId
      ..loginStatus = loginStatus ?? this.loginStatus
      ..mobile = mobile ?? this.mobile;
  }
}